// 统一管理首页模块接口
import request from "@/utils/request";
import type {AllResData,HospitalLevelAndRegionData,HospitalSearchKeyData} from '@/api/home/type'
// 通过枚举管理首页模块的接口地址
enum API {
  // 获取已有的医院的是数据接口地址
  HospitalInfo = "/hosp/hospital/",
  //医院等级标签
  HospitalLevelAndRegion="/cmn/dict/findByDictCode/",
  //根据搜索关键查询医院列表
  HospitalSearchKey="/hosp/hospital/findByHosname/"
}
// 获取医院的数据
export const reqHospital = (page: number, limit: number,hostype='',districtCode='') =>
  request.get<any,AllResData>(API.HospitalInfo + `${page}/${limit}?hostype=${hostype}&districtCode=${districtCode}`);
// 获取医院等级和地区
export const HospitalLevelAndRegion = (dictCode: string) =>
request.get<any,HospitalLevelAndRegionData>(API.HospitalLevelAndRegion + dictCode);

//根据搜索关键查询医院列表
export const HospitalSearchKey=(hosname:string)=>
request.get<any,HospitalSearchKeyData>(API.HospitalSearchKey + hosname);